define(['jquery', 'underscore', 'backbone', 'collections/app', 'views/app', 'views/about'], function ($, _, Backbone, appCollection, appView, aboutView) {

  var Router = Backbone.Router.extend({

    //routes
    routes: {
      '': 'index',
      '!/index': 'index',
	  '!/overview': 'overview',
	  '!/music': 'music',
	  '!/charts': 'charts',
	  '!/newdisc': 'newdisc',
	  '!/events': 'events',
	  '!/collect': 'collect',
      '!/about': 'about'
    },

    initialize: function () {

    },

    index: function () {
      $.getJSON("js/data/1.json", function(cc){
          var appV = new appCollection(cc);
          var view = new appView({model: appV});
          view.render();
      });
    },
	  
    //Overview Function for page `overview`
    overview: function(){
      $('#temp').html('overview');
	  },

    music: function () {
      $('#temp').html('music');
    },

    charts: function () {
      $('#temp').html('charts');
    },

    newdisc: function () {
      $('#temp').html('newdisc');
    },

    events: function () {
      $('#temp').html('events');
    },

    collect: function (){
      $('#temp').html('collect');
    },

    about: function () {
      var about_View = new aboutView();
      about_View.render();

    },

    // Helper function for cleaning up URLs
    routePath: function(path) {
        // Remove leading and trailing /
        if (path.charAt(0) == '/') {
            path = path.slice(1);
        }
        if (path.charAt(path.length - 1) == '/') {
            path = path.slice(0, path.length - 1);
        }
        // Route it!
        this.navigate(path, true);
        return false;
    }
    
  });

  return Router;
});